<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>

		<style type="text/css">
			.div1 {
				width: 100px;
				height: 100px;
				background-color: red;
				border: #FF0000 solid 1px;
			}
		</style>
	</head>

	<body>

		<div class="div1">
			div1
		</div>

		<div id="div2">
			div2
		</div>

		<script type="text/javascript">
			// 查找元素
			var div2 = document.getElementById("div2")
			/*属性的值要使用引号引起来*/
			div2.style.height = "100px";
			div2.style.width = "100px";
			/*在通过DOM设置CSS属性的时候,如果原来的属性是由多个单词组成的,此时要使用驼峰命名对应的样式来设置*/
			div2.style.backgroundColor = "blue"
			div2.style.border = "#FF0000 solid 1px"
		</script>
	</body>

</html>